import request from '@/utils/request'
const api = {
  creates: '/v1/auth/dept',
  deletes: '/v1/auth/dept',
  updates: '/v1/auth/dept',
  query: '/v1/auth/dept',
}

export const search = e => {
  return request({
    url: 'https://restapi.amap.com/v5/place/text',
    method: 'get',
    params: {
      ...e,
      key: '0e311f79dcd09657753981dc879371fe'
    }
  })
}

export const getList = e => {
  return request({
    url: api.query,
    method: 'get',
    params: e
  })
}

export const add = e => {
  return request({
    url: api.creates,
    method: 'post',
    data: e
  })
}

export const edit = (e, id) => {
  return request({
    url: api.updates + '/' + id,
    method: 'put',
    data: e
  })
}

export const deletes = id => {
  return request({
    url: api.creates + '/' + id,
    method: 'delete',
  })
}